export class I18nManager {
    private static _instance: I18nManager;
    public static get instance(): I18nManager {
        if (!this._instance) {
            this._instance = new I18nManager();
        }
        return this._instance;
    }

    private constructor() {}

    private language: string = 'zh';
    private texts: Record<string, Record<string, string>> = {};

    public setLanguage(lang: string): void {
        this.language = lang;
    }

    public setTexts(texts: Record<string, Record<string, string>>): void {
        this.texts = texts;
    }

    public t(key: string): string {
        return this.texts[this.language]?.[key] || key;
    }
} 